package com.third.customer.service;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.IService;
import com.third.customer.model.dao.param.CustomerHistoryParam;
import com.third.customer.model.dao.param.CustomerParam;
import com.third.customer.model.tables.Customer;
import com.third.customer.model.tables.CustomerHistory;
import com.third.customer.service.data.CustomerReport;
import com.third.customer.service.data.CustomerReq;
import com.third.customer.service.data.CustomerSwitchReq;
import org.springframework.web.multipart.MultipartFile;

import java.io.IOException;
import java.util.List;

/**
 * Created by hehuaichun on 2020/5/23.
 */
public interface CustomerService extends IService<Customer>{

    Page<Customer> list(CustomerParam param);

    Customer getById(Long companyId, Long customerId);

    Customer create(Long companyId, CustomerReq req);

    Customer modify(Long companyId, Long customerId, CustomerReq req);

    boolean delete(Long companyId, Long customerId);

    boolean switchGroup(Long companyId, Long customerId, CustomerSwitchReq req);

    /**
     * 约定好只可以上传excel固定格式的文件进行解析
     */
    boolean analysis(Long companyId, MultipartFile file, boolean forceUpdate) throws IOException;

    List<CustomerReport> getReports(CustomerParam param);

    Page<CustomerHistory> histories(CustomerHistoryParam param);

}
